package com.pro.service.imple;

import com.pro.mapper.JsNewCourseCommentMapper;
import com.pro.pojo.JsComment;
import com.pro.pojo.JsCourse;
import com.pro.service.JsNewCourseCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author cyj
 * @date 2002.3.29$ 14.00$
 * @content :
 */
@Service
public class JsNewCourseCommentServiceImple implements JsNewCourseCommentService {

    @Autowired
    private JsNewCourseCommentMapper mapper;

    /**
     * @author cyj
     * @date 2022.3.30$ 20.35$
     * @content : 获取后台人员评论计数
     */
    @Override
    public JsCourse getUserComment(Integer id) {
        return mapper.getUserComment(id);
    }

    /**
     * @author cyj
     * @date 2022.3.30$ 20.29$
     * @content : 获取后台人员评论计数
     */
    @Override
    public JsCourse getBeforeComment(Integer id) {
        return mapper.getBeforeComment(id);
    }

    /**
     * @author cyj
     * @date 2022.3.29$ 16.56$
     * @content : 获取后台人员评论计数
     */
    @Override
    public List<JsComment> getAfterTable(Integer type, Integer status, Integer page, Integer limit) {
        page = (page-1)*limit;
        return mapper.getAfterTable(type,status,page,limit);
    }

    /**
     * @author cyj
     * @date 2022.3.29$ 15.41$
     * @content : 获取后台人员评论计数
     */
    @Override
    public List<JsComment> getBeforeTable(Integer type, Integer status, Integer page, Integer limit) {
        page = (page-1)*limit;
        return mapper.getBeforeTable(type,status,page,limit);
    }

    /**
     * @author cyj
     * @date 2022.3.29$ 14.42$
     * @content : 获取后台人员评论计数
     */
    @Override
    public Integer countComm(Integer type,String userType,String commentDate) {
        return mapper.countComm(type,userType,commentDate);
    }
    /**
     * @author cyj
     * @date 2022.3.29$ 14.42$
     * @content : 获取后台人员计数
     */
    @Override
    public List<JsComment> countPeo(Integer type,String userType,String commentDate) {
        return mapper.countPeo(type,userType,commentDate);
    }

    /**
     * @author cyj
     * @date 2022.3.29$ 14.01$
     * @content : 评论个数统计
     */
    @Override
    public Integer CountCourseNum(String userType,Integer type,String status) {
        return mapper.CountCourseNum(userType,type,status);
    }
}
